home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / TUTORIAL.BIN / Plane.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-02-25  |  2.4 KB  |  63 lines

  1. import java.applet.Applet;
  2. import java.awt.Color;
  3. import java.awt.Component;
  4. import java.awt.Container;
  5. import java.awt.Event;
  6. import java.awt.Font;
  7. import java.awt.LayoutManager;
  8. import java.awt.Panel;
  9. import java.net.MalformedURLException;
  10. import java.net.URL;
  11. import symantec.itools.lang.Context;
  12. import symantec.itools.multimedia.Animator;
  13. import symantec.itools.net.RelativeURL;
  14.  
  15. public class Plane extends Applet {
  16.    Animator animatorPlane;
  17.  
  18.    public void init() {
  19.       super.init();
  20.       Context.setDocumentBase(((Applet)this).getDocumentBase());
  21.       ((Container)this).setLayout((LayoutManager)null);
  22.       ((Panel)this).addNotify();
  23.       ((Applet)this).resize(520, 80);
  24.       ((Component)this).setFont(new Font("Dialog", 1, 12));
  25.       ((Component)this).setForeground(new Color(0));
  26.       ((Component)this).setBackground(new Color(16777215));
  27.       this.animatorPlane = new Animator();
  28.       this.animatorPlane.reshape(200, 8, 128, 71);
  29.       ((Container)this).add(this.animatorPlane);
  30.       this.animatorPlane.setDelay(250);
  31.       this.animatorPlane.setNumLoops(1);
  32.       this.animatorPlane.setRepeatMode(true);
  33.  
  34.       try {
  35.          URL[] tempURL = new URL[15];
  36.          tempURL[0] = RelativeURL.getURL("Images/plane01.gif");
  37.          tempURL[1] = RelativeURL.getURL("Images/plane02.gif");
  38.          tempURL[2] = RelativeURL.getURL("Images/plane03.gif");
  39.          tempURL[3] = RelativeURL.getURL("Images/plane04.gif");
  40.          tempURL[4] = RelativeURL.getURL("mages/plane05.gif");
  41.          tempURL[5] = RelativeURL.getURL("Images/plane06.gif");
  42.          tempURL[6] = RelativeURL.getURL("Images/plane07.gif");
  43.          tempURL[7] = RelativeURL.getURL("Images/plane08.gif");
  44.          tempURL[8] = RelativeURL.getURL("Images/plane09.gif");
  45.          tempURL[9] = RelativeURL.getURL("Images/plane10.gif");
  46.          tempURL[10] = RelativeURL.getURL("Images/plane11.gif");
  47.          tempURL[11] = RelativeURL.getURL("Images/plane12.gif");
  48.          tempURL[12] = RelativeURL.getURL("Images/plane13.gif");
  49.          tempURL[13] = RelativeURL.getURL("Images/plane14.gif");
  50.          tempURL[14] = RelativeURL.getURL("Images/plane15.gif");
  51.          this.animatorPlane.setImageList(tempURL);
  52.       } catch (MalformedURLException var2) {
  53.       }
  54.  
  55.       this.animatorPlane.setClearFrame(false);
  56.       this.animatorPlane.setPreviewMode(true);
  57.    }
  58.  
  59.    public boolean handleEvent(Event event) {
  60.       return super.handleEvent(event);
  61.    }
  62. }
  63.